package com.lambert.ginkgo.exception;

import lombok.Getter;
import org.springframework.http.HttpStatusCode;

/**
 * WebClient自定义异常类
 */
@Getter
public class WebClientException extends RuntimeException {
    private final HttpStatusCode statusCode;
    private final String responseBody;
    private final boolean retryable;

    public WebClientException(String message) {
        super(message);
        this.statusCode = null;
        this.responseBody = null;
        this.retryable = false;
    }

    public WebClientException(String message, Throwable cause) {
        super(message, cause);
        this.statusCode = null;
        this.responseBody = null;
        this.retryable = false;
    }

    public WebClientException(String message, HttpStatusCode statusCode, String responseBody, boolean retryable) {
        super(message);
        this.statusCode = statusCode;
        this.responseBody = responseBody;
        this.retryable = retryable;
    }

}